package s09;

import base.Bean2;
import net.sf.cglib.beans.BulkBean;

/**
 * @author wangpp
 */
public class BulkBeanTest {
    public static void main(String[] args) {
        BulkBean bulkBean = BulkBean.create(Bean2.class,
                new String[]{"getValue"},
                new String[]{"setValue"},
                new Class[]{String.class}
        );

        Bean2 bean2 = new Bean2();

        bean2.setValue("H");

        Object[] propertyValues = bulkBean.getPropertyValues(bean2);
        System.out.println(propertyValues.length); //1
        System.out.println(propertyValues[0]); //H

        bulkBean.setPropertyValues(bean2, new Object[]{"Hello world"});

        System.out.println(bean2.getValue());


    }
}
